<?php

namespace JLPay\Models\Openmerch\Change;

use JLPay\Models\BaseRequest;

/**
 * 商户定点清算修改请求
 */
class FixedWithdrawModifyRequest extends BaseRequest
{
    public const API_URL = '/open/merch/access/fixed-withdraw/modify';
    
    protected string $orgNo = '';           // 机构号
    protected string $applyId = '';         // 申请单id
    protected string $merchNo = '';         // 商户号
    protected string $operateType = '';     // 设置方式，0-取消1-设置
    protected array $withdrawTimeList = []; // 定点清算时间列表

    /**
     * 设置机构号
     *
     * @param string $orgNo
     * @return self
     */
    public function setOrgNo(string $orgNo): self
    {
        $this->orgNo = $orgNo;
        return $this;
    }

    /**
     * 设置申请单id
     *
     * @param string $applyId
     * @return self
     */
    public function setApplyId(string $applyId): self
    {
        $this->applyId = $applyId;
        return $this;
    }

    /**
     * 设置商户号
     *
     * @param string $merchNo
     * @return self
     */
    public function setMerchNo(string $merchNo): self
    {
        $this->merchNo = $merchNo;
        return $this;
    }

    /**
     * 设置设置方式
     *
     * @param string $operateType
     * @return self
     */
    public function setOperateType(string $operateType): self
    {
        $this->operateType = $operateType;
        return $this;
    }

    /**
     * 设置定点清算时间列表
     *
     * @param array $withdrawTimeList
     * @return self
     */
    public function setWithdrawTimeList(array $withdrawTimeList): self
    {
        $this->withdrawTimeList = $withdrawTimeList;
        return $this;
    }

    /**
     * 转换为数组
     *
     * @return array
     */
    public function toArray(): array
    {
        $data = parent::toArray();
        $data['org_no'] = $this->orgNo;
        $data['apply_id'] = $this->applyId;
        $data['merch_no'] = $this->merchNo;
        $data['operate_type'] = $this->operateType;
        $data['withdraw_time_list'] = $this->withdrawTimeList;
        return $data;
    }
} 